GBML manual / Text

draw_text_3d_sheared_scaled

draw_text_3d_sheared at any size: draws text in world space with the line curving away from you, leaned the way italic writing leans, and made wider and taller (or smaller) by xscale and yscale. xshear slides the top of the letters sideways (a positive number leans them right, a negative number leans them left, and 0 is exactly draw_text_3d_scaled), and it means the same at every size: 0.5 is half a pixel sideways for every pixel up or down on the screen. shape and depth work exactly as they do in draw_text_3d: depth goes up to 6, and the curve grows with the text, so a depth means the same thing at any size. A negative xscale or yscale flips the whole line, curve and all. (x, y) is the same LEFT/CENTER/RIGHT anchor draw_text already uses, and the point the line grows from; it counts from the top-left, like every other world position. Inside a Draw GUI event it is fixed to the screen instead, and (x, y) counts from the screen’s top-left pixel.

Works differently on Game Boy - The Game Boy cannot squeeze letters row by row: with an xshear a 3D text on the screen leans in 4 steps of 2 lines and the shape is left out; without one it is as draw_text_3d (a copy behind, an arch, the lens).

Works differently on Game Boy Color - The Game Boy Color cannot squeeze letters row by row: with an xshear a 3D text on the screen leans in 4 steps of 2 lines and the shape is left out; without one it is as draw_text_3d (a copy behind, an arch, the lens).

Sega Genesis: not available

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

draw_text_3d_sheared_scaled(x, y, text, shape, depth, xshear, xscale, yscale)

Arguments

NameType
xreal
yreal
textstring
shapetext_shape
depthint
xshearreal
xscalereal
yscalereal

Returns

Nothing.

Description

draw_text_3d_sheared at any size: the line of text curves away from you, leans the way italic writing leans, and is made wider and taller (or smaller) by xscale and yscale. It is the lean of draw_text_3d_sheared and the size of draw_text_3d_scaled in one call.

The first six numbers are draw_text_3d_sheared's own, in the same order: (x, y), the text, the shape, the depth and the lean xshear. The last two are the size, as in draw_text_3d_scaled. Nothing you already know about those pages changes:

A line cannot also be turned or lifted at one end: the curve belongs to the screen's rows, so neither would line up with it. Use draw_text_warped to turn text, without the curve.

One line only

The curve is made for a single line of text. A "\n" in the string ends the text there: only the first line is drawn, and what follows is left out. To curve several lines, draw each with its own call.

What it costs

It costs what draw_text_3d_sheared costs: one of the 32 matrices and two of the 8 row-by-row effects for as long as the call keeps being made, and every letter of a word of 12 letters or fewer is a sprite of its own. A room change keeps two of the eight for itself, so three 3D things at once is the most a screen can hold. A line with a lean is drawn in the bigger box, and past 2 times bigger the ends of the line are cut off (see draw_text_warped). Ask for more than there is and a development build stops with a message that names every call holding a slot.

Example

text_align(ALIGN_CENTER);
draw_text_3d_sheared_scaled(x, y - 24, "LEAN", TEXT_BULGE, 4, 0.5, 1.5, 1);

A label, centered above this instance, one and a half times as wide as it is tall, pinched at the top and bottom of every letter and leaning to the right (depth 4 needs a bold 32 pixel font).

text_align(ALIGN_CENTER);
var lean = wave(-1, 1, 120, 0);
draw_text_3d_sheared_scaled(x, y - 24, "LEAN", TEXT_LEAN_BACK, 3, lean, 2, 2);

A word twice the size whose lean swings from -1 to 1 and back once every two seconds (120 frames), tipped back the whole time.

On the GBA

Costs what draw_text_3d_sheared costs: ONE of the hardware’s 32 affine matrices and TWO of the console’s 8 row-by-row (H-Blank) effects, for as long as the call keeps being made. The lean and the size are numbers in that same matrix, so they need no effect of their own. A line with a lean is drawn in the bigger box (twice the sprite’s size in each direction, which the console takes about twice as long to draw), and a line with a lean of 0 goes back to the sprite’s own box; past 2 times bigger the ends of the line are cut off, as in draw_text_3d_scaled. Every letter gets a sprite of its own for a word of up to 12 letters (spaces do not count); a longer word is still drawn, but its letters share sprites, so it leans in clumps, and a development build says so once in the log. A room transition keeps two of the eight row-by-row effects for itself, so at most three 3D things (texts, or sprites from draw_sprite_3d) can be on screen at once. Asking for more than there is stops the game with a message that names every call holding a slot (a release build draws the line flat instead). depth 0 draws the flat line, leaned and sized, and with an xshear of 0 and scales of 1, plain draw_text. Depths 4 to 6 need a font drawn from sprites 32 pixels tall (a smaller font is drawn at depth 3 and a development build says so once in the log). A line cannot also be turned: use draw_text_warped for that, without the curve.

See also: draw_text_3d_sheareddraw_text_3d_scaleddraw_text_3ddraw_text_sheareddraw_text_warpedtext_alignfont_set